package _15_command_pattern.v_common;

import _15_command_pattern.v_common.command.Command;
import _15_command_pattern.v_common.command.ConcreteCommand1;
import _15_command_pattern.v_common.receiver.ConcreteReciver1;
import _15_command_pattern.v_common.receiver.Receiver;

/**
 * @Description: 场景类
 * @Auther: 2019/6/25 9:20 by zhang.jy
 */
public class Client {
	public static void main(String[] args) {
		//首先声明调用者Invoker
		Invoker invoker = new Invoker();
		//定义接收者
		Receiver receiver = new ConcreteReciver1();
		//定义一个发送给接收者的命令
		Command command = new ConcreteCommand1(receiver);
		//把命令交给调用者去执行
		invoker.setCommand(command);
		invoker.action();
	}
}